package com.efast.cafe.portal.dao.common;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.efast.cafe.portal.bean.common.AttachmentBean;
import com.efast.cafe.portal.entity.common.PortalAttachment;
import com.efast.cafe.portal.entity.common.PortalAttachmentBean;
import com.efast.cafe.portal.entity.common.PortalAttachmentForm;

public interface PortalAttachmentDao {

	/**
	 * 保存附件信息
	 * @param portalAttachment
	 * @return
	 */
	
	public int saveAttrachment(PortalAttachment portalAttachment);
	/**
	 * 删除附件
	 * @param attrachmentId
	 */
	public void deleteAttrachment(@Param(value="attrachmentId")Integer attrachmentId,@Param(value="companyCode")String companyCode);
	
	
	/**
	 * 获取表单的附件List
	 * @param formId
	 * @param group
	 * @param companyCode
	 * @return
	 */
	public List<AttachmentBean> findAttachList(@Param(value="formId")String formId, @Param(value="group")String group, @Param(value="companyCode")String companyCode);

	/**
	 * 获取表单的附件List
	 * @param formId
	 * @param group
	 * @param companyCode
	 * @return
	 */
	public List<AttachmentBean> findAttachListByTable(@Param(value="formId")String formId, @Param(value="group")String group, @Param(value="companyCode")String companyCode);

	/**
	 * 保存附件和表单的关系
	 * @param attachmentForm
	 */
	public void saveAttachmentForm(@Param("attachmentForms")List<PortalAttachmentForm> attachmentForms,@Param("companyCode")String companyCode,@Param("requestUser")String requestUser);

	
	public void deleteAttachmentForm(@Param(value="formId")String formId);
	
	public PortalAttachment queryAttachmentById(@Param(value="id")Integer id,@Param(value="companyCode")String companyCode);

	void updateAttrachmentComments(PortalAttachment att);


	public PortalAttachmentForm queryAttachmentFormById(@Param(value="id")Integer id,@Param(value="companyCode")String companyCode);

	 List<PortalAttachmentBean> queryAttachmentFormListByFormId(@Param(value="formId")String formId);

}
